#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isPalindrome(string s) {
        string temp;


        string::iterator it1 = s.begin();
        while (it1 != s.end())
        {
            if (*it1 >= 'a' && *it1 <= 'z' || (*it1 >= '0' && *it1 <= '9'))
                temp += (*it1);
            if (*it1 >= 'A' && *it1 <= 'Z')
                temp += ((*it1) + 32);
            it1++;
        }
        string temp1 = temp;
        it1 = temp.begin();
        string::iterator it2 = temp.end();
        reverse(it1, it2);
        if (temp == temp1)
            return true;
        else
            return false;
    }
};
